package com.eastjet.maintenance.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import lombok.Data;
import lombok.Value;

/**
 * 存放位置
 *
 * @TableName storage_location
 */
@TableName(value = "storage_location")
@Data
public class StorageLocation implements Serializable {
    /**
     * 存放id编号
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 存放位置名称
     */
    @TableField(value = "deposit_name")
    private String depositName;

    /**
     * 存放位置编码
     */
    @TableField(value = "deposit_encode")
    private String depositEncode;

    /**
     * 排序
     */
    @TableField(value = "deposit_sort")
    private Integer depositSort;

    /**
     * 状态(1.启动:2.停用)
     */
    @TableField(value = "deposit_state")
    private Integer depositState;

    /**
     * 备注
     */
    @TableField(value = "deposit_remark")
    private String depositRemark;

    /**
     * 创建人
     */
    @TableField(value = "created_by")
    private String createdBy;

    /**
     * 创建时间
     */
    @TableField(value = "creation_time")
    private Date creationTime;

    /**
     * 更新人
     */
    @TableField(value = "updater")
    private String updater;

    /**
     * 更新时间
     */
    @TableField(value = "updated")
    private Date updated;

    /**
     * 逻辑删除
     */
    @TableField(value = "tombstone")
    private Integer tombstone;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        StorageLocation other = (StorageLocation) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getDepositName() == null ? other.getDepositName() == null : this.getDepositName().equals(other.getDepositName()))
                && (this.getDepositEncode() == null ? other.getDepositEncode() == null : this.getDepositEncode().equals(other.getDepositEncode()))
                && (this.getDepositSort() == null ? other.getDepositSort() == null : this.getDepositSort().equals(other.getDepositSort()))
                && (this.getDepositState() == null ? other.getDepositState() == null : this.getDepositState().equals(other.getDepositState()))
                && (this.getDepositRemark() == null ? other.getDepositRemark() == null : this.getDepositRemark().equals(other.getDepositRemark()))
                && (this.getCreatedBy() == null ? other.getCreatedBy() == null : this.getCreatedBy().equals(other.getCreatedBy()))
                && (this.getCreationTime() == null ? other.getCreationTime() == null : this.getCreationTime().equals(other.getCreationTime()))
                && (this.getUpdater() == null ? other.getUpdater() == null : this.getUpdater().equals(other.getUpdater()))
                && (this.getUpdated() == null ? other.getUpdated() == null : this.getUpdated().equals(other.getUpdated()))
                && (this.getTombstone() == null ? other.getTombstone() == null : this.getTombstone().equals(other.getTombstone()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getDepositName() == null) ? 0 : getDepositName().hashCode());
        result = prime * result + ((getDepositEncode() == null) ? 0 : getDepositEncode().hashCode());
        result = prime * result + ((getDepositSort() == null) ? 0 : getDepositSort().hashCode());
        result = prime * result + ((getDepositState() == null) ? 0 : getDepositState().hashCode());
        result = prime * result + ((getDepositRemark() == null) ? 0 : getDepositRemark().hashCode());
        result = prime * result + ((getCreatedBy() == null) ? 0 : getCreatedBy().hashCode());
        result = prime * result + ((getCreationTime() == null) ? 0 : getCreationTime().hashCode());
        result = prime * result + ((getUpdater() == null) ? 0 : getUpdater().hashCode());
        result = prime * result + ((getUpdated() == null) ? 0 : getUpdated().hashCode());
        result = prime * result + ((getTombstone() == null) ? 0 : getTombstone().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", depositName=").append(depositName);
        sb.append(", depositEncode=").append(depositEncode);
        sb.append(", depositSort=").append(depositSort);
        sb.append(", depositState=").append(depositState);
        sb.append(", depositRemark=").append(depositRemark);
        sb.append(", createdBy=").append(createdBy);
        sb.append(", creationTime=").append(creationTime);
        sb.append(", updater=").append(updater);
        sb.append(", updated=").append(updated);
        sb.append(", tombstone=").append(tombstone);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}